--[[
	Homework 12 by Henrique Polido
]]

require("graph")

local graph = GRAPH.New()
function Edge( data ) graph:AddEdge( data ) end
dofile("data.lua")

--[[
local graph2 = GRAPH.New()
function Edge( data ) graph2:AddEdge( data ) end
dofile("data2.lua")

local graph3 = GRAPH.New()
function Edge( data ) graph3:AddEdge( data ) end
dofile("data3.lua")
--local result = graph3:MaxFlow("S", "T")
]]--


local result = graph:MaxFlow("New York", "Los Angeles")
print("Flow from New York to Los Angles")
for edge, value in pairs( result ) do
	print( "", tostring(edge) ,"\t", tostring(value))
end

local result2 = graph:MaxFlow("Atlanta", "Los Angeles")
print("Flow from Atlanta to Los Angles")
for edge, value in pairs( result ) do
	print( "", tostring(edge) ,"\t", tostring(value))
end

local result3 = graph:MaxFlow("Kansas City", "San Francisco")
print("Flow from Kansas City to San Francisco")
for edge, value in pairs( result ) do
	print( "", tostring(edge) ,"\t", tostring(value))
end

local result4 = graph:MaxFlow("Kansas City", "Los Angeles")
print("Flow from Kansas City to Los Angeles")
for edge, value in pairs( result ) do
	print( "", tostring(edge) ,"\t", tostring(value))
end


